package com.appwoo.txtws.adapter;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.appwoo.txtws.bean.AppInfo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AppAdapter extends ArrayAdapter<AppInfo>
{
  private Activity activity;
  private boolean show = false;
  private Map<Integer, View> viewMap = new HashMap();

  public AppAdapter(Activity paramActivity, List<AppInfo> paramList)
  {
    super(paramActivity, 0, paramList);
    this.activity = paramActivity;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    View localView = (View)this.viewMap.get(Integer.valueOf(paramInt));
    if (localView == null)
      localView = ((Activity)getContext()).getLayoutInflater().inflate(2130903122, null);
    final AppInfo localAppInfo = (AppInfo)getItem(paramInt);
    ((TextView)localView.findViewById(2131493155)).setText(localAppInfo.getAppLabel());
    ((ImageView)localView.findViewById(2131493154)).setImageDrawable(localAppInfo.getAppIcon());
    Button localButton = (Button)localView.findViewById(2131493156);
    localButton.setText("卸载");
    localButton.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        Intent localIntent = new Intent();
        Uri localUri = Uri.parse("package:" + localAppInfo.getPkgName());
        localIntent.setAction("android.intent.action.DELETE");
        localIntent.setData(localUri);
        AppAdapter.this.activity.startActivity(localIntent);
      }
    });
    return localView;
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.adapter.AppAdapter
 * JD-Core Version:    0.6.2
 */